% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/translate.R
\name{trans}
\alias{trans}
\title{Translate identifiers}
\usage{
trans(v, to = NULL, ttable = NULL, by = NULL)
}
\arguments{
\item{v}{Vector of any type.}

\item{to}{Character. Corresponding identifier format to translate
our vector \code{v} to.}

\item{ttable}{Translation table. Must be a \code{data.frame}
containing the columns specified by \code{to} and \code{by}}

\item{by}{Character. Column key for translation.}
}
\description{
\code{trans} translates a vector of identifiers from one format to
another according to a given translation table (\emph{e.g.},
translating question IDs to question name).
}
\section{Warning}{
 This function is meant to serve as a constructor
    for identifier specific translation functions --- for example,
    see the function \code{\link{to_qids}}. It's not
    particularly useful or inuitive for direct use.
}

\examples{
\dontrun{
# Given a vector of question IDs saved to qids and we want the
# corresponding tag names using the translation table `qtable`.
trans(qids, to = "name", ttable = qtable, by = "question_id")
}

}
\seealso{
\code{\link{to_qids}} for question IDs,
    \code{\link{to_qnames}} for question names,
    \code{\link{to_cids}} for country IDs, \code{\link{to_cnames}}
    for country names.
}
\concept{translation helper functions}
